Imports Oracle.DataAccess.Client ' VB.NET

Public Class Form1
    Dim oradb As String = "Data Source=192.168.1.44;User Id=darellano;Password=davidctm;" 'VB.NET
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim conn As New OracleConnection(oradb)
        Dim ds As New DataSet()
        conn.ConnectionString = oradb
        Try
            conn.Open()

            Dim cmd As New OracleCommand
            cmd.Connection = conn
            cmd.CommandText = "Select * FROM Usuarios where nombre='" + TextBox1.Text + "'"
            cmd.CommandType = TextBox1.Text

            Dim sda As New OracleDataAdapter(cmd)

            sda.Fill(ds)

            If Not IsNothing(ds) Then
                If ds.Tables.Count > 0 Then
                    If ds.Tables(0).Rows.Count > 0 Then
                        
                    Else
                        MessageBox.Show("No existen resultados")
                    End If
                Else
                    MessageBox.Show("No existen resultados")
                End If
            Else
                MessageBox.Show("No existen resultados")
            End If


            conn.Close()
        Catch ex As Exception ' catches any error
            MessageBox.Show(ex.Message.ToString())
        Finally
        End Try
    End Sub
End Class
